package com.optimatch.ui.view.customComponents.pages;

import java.awt.Color;

import javax.swing.BoxLayout;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import com.optimatch.model.utils.AffichageUtil;

public class ResultGeneralPanel extends JPanel{
	private JPanel resultat;
	private JTable table;
	private Object[][] data;
	private String[] columns;
	private JScrollPane scroll;

	public ResultGeneralPanel() {
		super();
		init();
	}
	private void init() {
		this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
		scroll = new JScrollPane();
		resultat = new JPanel();
		this.add(scroll);
//		resultat.add(table);
//		this.add(resultat);
	}
	public Object[][] getData() {
		return data;
	}
	public void setData(Object[][] data) {
//		this.data = data;
//		this.table.repaint();
		this.remove(scroll);
		String[] columns = AffichageUtil.getListeJournee();
		System.out.println(columns.toString());
		this.table = new JTable(data,columns);
		table.setRowHeight(30);
		table.setBackground(new Color(217,226,243));
		scroll = new JScrollPane(table);
		this.add(scroll);
		repaint();
	}
	public String[] getColumns() {
		return columns;
	}
	public void setColumns(String[] columns) {
		this.columns = columns;
		repaint();
	}
}
